<%@ page contentType="text/html; charset=UTF-8"%>
<% response.setContentType("text/html;charset=UTF-8"); request.setCharacterEncoding("UTF-8"); %>
<jsp:useBean id="action" scope="request" class="com.pubpage.sys_upload_file.Action" />
<jsp:useBean id="view" scope="request" class="com.pubpage.sys_upload_file.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")) {return;} %>
<jsp:useBean id="DataView" scope="request" type="com.pub.database.DataView"/>
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request" type="com.pub.database.DataViewForm"/>
<jsp:setProperty name="DataViewForm" property="submitMethod" value="POST"/>
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="100"/>
<jsp:setProperty name="DataViewForm" property="nowPageNum"/>
<jsp:setProperty name="DataViewForm" property="dataViewAction"/>
<jsp:setProperty name="DataViewForm" property="filterCol"/>
<jsp:setProperty name="DataViewForm" property="filterValue"/>
<jsp:setProperty name="DataViewForm" property="dvOrderByFields"/>
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq"/>
<!-- DataView 設定結束 -->
<html>
<head>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/PUBPAGE/general/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2" src="/PUBPAGE/general/commscript.js" ></script>
<script type="text/javascript" language="javascript1.2" src="/PUBPAGE/general/commhtmlscript.js" ></script>
<script language="JavaScript" type="text/JavaScript">
function fc_delfile(varSN){
   if(confirm('是否確定刪除?')){
     var openurl = "/PUBPAGE/DeleteFile.jsp?db_alias=<%=view.getDB_Alias()%>&table=<%=view.getatt_table()%>&flow_code=" + document.DataViewForm.flow_code.value + "&file_id=" + document.all.item("file_id" + varSN).value + "&flow_num="+  document.DataViewForm.flow_num.value;
     window.showModalDialog(openurl) ;
     alert('刪除成功!');
     getDataViewHtml();
   }
}
function getDataViewHtml(){
  xmlDoc=getXmlDoc();
  openURL = "/PUBPAGE/sys_upload_file.jsp?prgAction=getData&"+ getFormAllObject(document.DataViewForm);
  xmlDoc.Open("POST",openURL,false);
  xmlDoc.send();
  document.all.item('divDataView').innerHTML=xmlDoc.responseText;
}

</script>
<base target='_self'/>
</head>
<body bgcolor="#ffffff" onload="<%=view.getOnloadScript()%>">
<FORM enctype="multipart/form-data" method="post" action="<%=request.getRequestURI()%>">
<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="1"  id="tbl_upload_file" width="100%">
<tr><td colspan="2">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
<TR><TD  BACKGROUND="/PUBPAGE/pub_images/title/title_bg.gif"><DIV ALIGN="LEFT"><IMG SRC="/PUBPAGE/pub_images/title/title01.gif" WIDTH="18" HEIGHT="24" HSPACE="0" alt=""/><IMG SRC="/PUBPAGE/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt=""/></DIV></TD>
<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE" BACKGROUND="/PUBPAGE/pub_images/title/title_bg.gif" CLASS="TITLE"><%=view.getPrgTitle()%></TD>
<TD BACKGROUND="/PUBPAGE/pub_images/title/title_bg.gif"><DIV ALIGN="RIGHT"><IMG SRC="/TPS/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt=""/><IMG SRC="/PUBPAGE/pub_images/title/title02.gif" WIDTH="18" HEIGHT="24" HSPACE="0" alt=""/></DIV></TD>
</TR></TABLE>
</td></tr>

<tr>
  <td><%=view.getFile_kndTitle()%></td>
  <td><select name="file_knd" class="select">
    <option></option>
    <%=view.getFile_kndOptionHTML()%>
    </select>
  </td>
</tr>
<tr>
  <td><%=view.getFile_nameTitle()%></td>
  <td><input type="file" name="File" size="20" maxlength="20"></td>
</tr>
<tr>
  <td><%=view.getFile_descTitle()%></td>
  <td><input type="text" name="file_desc" size="30" maxlength="50"></td>
</tr>
<tr><td colspan="2">
  <input type="button" value="<%=view.getBtnUploadTitle()%>" onclick="javascript:document.forms[0].prgAction.value='upload';document.forms[0].submit();" class="button b_normal">
  <input type="reset" value="<%=view.getBtnResetTitle()%>" class="button b_normal">
  <input type="button" value="<%=view.getBtnExitTitle()%>" class="button b_normal" onclick="<%=view.getOnExitScript()%>">
  <input type="hidden" name="prgAction"/>
  <input type="hidden" name="att_table" value="<%=view.getatt_table()%>"/>
  <input type="hidden" name="flow_code" value="<%=view.getflow_code()%>"/>
  <input type="hidden" name="flow_num" value="<%=view.getflow_num()%>"/>
  <input type="hidden" name="max_size" value="<%=view.getMax_size()%>"/>
  <input type="hidden" name="att_ifrm_name" value="<%=view.getatt_ifrm_name()%>"/>
  <input type="hidden" name="file_storage" value="<%=view.getfile_storage()%>"/>
  <input type="hidden" name="file_path" value="<%=view.getfile_path()%>"/>
  <input type="hidden" name="knd" value="<%=view.getknd()%>"/>
  <input type="hidden" name="DB_Alias" value="<%=view.getDB_Alias()%>"/>

</td></tr>
 <TR>
<td nowrap colspan="2" class="text_head"><br /><IMG SRC="/PUBPAGE/pub_images/title/title02_bg1.gif">
 <strong><%=view.getFrm1NameTitle()%></strong><IMG SRC="/PUBPAGE/pub_images/title/title2_bg2.gif"><br /></td>
 </TR>
<TR>
<TD colspan="2">
<div id="divDataView"><%=view.getDataViewHtml() %></div>
</TD>
</TR >
</TABLE >
</FORM>
</body>
</html>
